//
//  BBEPicturelayout.swift
//  PictureShow
//
//  Created by apple on 16/4/27.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit

class BBEPicturelayout: UICollectionViewFlowLayout {
    
    override func prepareLayout() {
        
        let magin : CGFloat = 10
        let cols : CGFloat = 3
        let cellWH = (UIScreen.mainScreen().bounds.width - (cols + 1) * magin) / cols
        
        itemSize = CGSize(width: cellWH, height: cellWH)
        
        collectionView?.contentInset = UIEdgeInsetsMake(magin + 64, magin, magin, magin)
        
        minimumInteritemSpacing = magin
        minimumLineSpacing = magin
    }
}
